<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button onclick="f(this)" >删除</button>
    <ul>
        <li>古月方源</li>
        <li>古月方正</li>
        <li>古月药乐</li>
    </ul>
</body>
</html>
<script>
    var ul=document.querySelector("ul")
    function f(a){
        ul.removeChild(ul.children[0])
        if(ul.children.length==0){
            a.disabled=true
        }
    }
</script>